-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I2C Rust #3
Conversation
bcm2835_rust: continue Add functions Caution: the problem of dev.msg_buf and curr_msg.buf is needed to be reconciled i2c: Add basic structure for ffi bindings. Signed-off-by: Nostalgia <[email protected]>
bcm2835_rust: continue Add functions Caution: the problem of dev.msg_buf and curr_msg.buf, we need to consruct a elegant way for a replacement of ptr++ . Signed-off-by: Nostalgia <[email protected]>
bcm2835_rust: continue Add functions Caution: the problem of dev.msg_buf and curr_msg.buf, we need to consruct a elegant way for a replacement of ptr++ . Signed-off-by: Nostalgia <[email protected]>
Add bcm2835_i2c_xfer Add Error: EREMOTEIO Add bcm2835_i2c_func Signed-off-by: Nostalgia <[email protected]>
Add bcm2835_i2c_xfer Add Error: EREMOTEIO Add bcm2835_i2c_func Signed-off-by: Nostalgia <[email protected]>
bcm2835_rust: 部分修正,尝试填充probe函数。 i2c mod: 添加i2c_quirks。 Signed-off-by: Nostalgia <[email protected]>
bcm2835_rust: 部分修正,尝试填充probe函数。 i2c mod: 添加i2c_bcm2835quirks。 device, platform, clk. Signed-off-by: Nostalgia <[email protected]>
bcm2835_rust: 部分修正,尝试填充probe函数。 i2c mod: 添加i2c_bcm2835quirks。 device, platform, clk. Signed-off-by: Nostalgia <[email protected]>
bcm2835_rust: 部分修正,尝试填充probe函数。 i2c mod: 添加i2c_bcm2835quirks。 device, platform, clk. Signed-off-by: Nostalgia <[email protected]>
rust/kernel/platform.rs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以看下 platform.rs 里 Adapter 的 register 和 probe_callback 方法,利用它们也许可以自动将 i2c_adapter 要干的活做了,至少能做一部分
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我建议检查一下我之前的提交有没有出现修改c文件的情况,如果有就回滚一下,我怕我误操作了
rust/kernel/lib.rs
Outdated
@@ -54,7 +54,7 @@ pub mod init; | |||
pub mod io_buffer; | |||
pub mod io_mem; | |||
#[cfg(CONFIG_IOMMU_IO_PGTABLE)] | |||
pub mod io_pgtable; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里为什么注释掉了呢?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我这里显示找不到相关mod 可能又是无意间修改了什么不知道的 (悲)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里这个mod已经被上一行的cfg条件屏蔽掉了,不会引入并编译,不需要再注释了
可能是之前仓库遗留的一些东西
pub fn kmalloc<T>(&self) -> Result<*mut T> { | ||
let size = core::mem::size_of::<T>(); | ||
let ptr = unsafe { | ||
bindings::devm_kmalloc(self.ptr, size, bindings::GFP_KERNEL | bindings::__GFP_ZERO) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
devm_kmalloc这里第3个参数应该要从外部传入
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
第三个参数是bindings里的,这里怎么做好?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GFP的宏定义大多已经binding出来了,可以直接用。不过鉴于这个devm_kmalloc似乎没有什么地方用到,可以先不用封装它
bcm2835_rust: 部分修正,尝试填充probe函数。 i2c mod: 添加i2c_bcm2835quirks。 device, platform, clk. Signed-off-by: Nostalgia <[email protected]>
修正函数中数值及类型部分 Signed-off-by: Nostalgia <[email protected]>
修正函数中数值及类型部分,及所有权部分。 Signed-off-by: Nostalgia <[email protected]>
No description provided.